From aeb7d7395583e3c3b268d8c93730e8a1fdf21f5a Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Mon, 20 Oct 2008 15:14:55 +0100 Subject: [PATCH] vtd: make the xen_in_range/tboot_in_range checkings also work for IA64. Signed-off-by: Anthony Xu Signed-off-by: Dexuan Cui --- xen/drivers/passthrough/vtd/iommu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index dd5d7a4e79..4a855c772f 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1012,7 +1012,7 @@ static int intel_iommu_domain_init(struct domain *d) { struct hvm_iommu *hd = domain_hvm_iommu(d); struct iommu *iommu = NULL; - u64 i; + u64 i, j, tmp; struct acpi_drhd_unit *drhd; drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list); @@ -1031,11 +1031,13 @@ static int intel_iommu_domain_init(struct domain *d) */ for ( i = 0; i < max_page; i++ ) { - if ( xen_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) || - tboot_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) ) + if ( xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) || + tboot_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) ) continue; - iommu_map_page(d, i, i); + tmp = 1 << (PAGE_SHIFT - PAGE_SHIFT_4K); + for ( j = 0; j < tmp; j++ ) + iommu_map_page(d, (i*tmp+j), (i*tmp+j)); } setup_dom0_devices(d); -- 2.30.2